<%@ page import="framework.common.Common" %>
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">

<html>
<head>
    <meta charset="utf-8">
    <title>牛皮</title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <meta name="apple-mobile-web-app-status-bar-style" content="black">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="format-detection" content="telephone=no">

    <!-- 引入框架的js、css等 -->
    <jsp:include page="${request.contextPath}/static/include.jsp" flush="true" />
    <link rel="stylesheet" href="<%=request.getContextPath()%>/static/css/modal.css?ver=<%=System.currentTimeMillis()%>" /> <%-- 模态框的css --%>
    <%-- 引入formSelects样式 --%>
    <link rel="stylesheet" type="text/css" href="${request.contextPath}/libs/layuiExt/css/formSelects-v4.css" />

    <script type="text/javascript">
        //一般直接写在一个js文件中
        layui.config({
            base: '${request.contextPath}/libs/layuiExt/js/' //此处路径请自行处理, 可以使用绝对路径
        }).extend({
            treeGrid:'treeGrid'
            ,formSelects: 'formSelects-v4'
        }).use([ 'form', 'layer', 'treeGrid', 'formSelects'], function() {
            var treeGrid = layui.treeGrid
                ,form = layui.form
                ,$ = layui.jquery
                ,formSelects = layui.formSelects;

            verifyExt(form);
            form.on('submit(*)', function(data){ //form校验成功才会执行下面的代码
                //怎么刷新树状table
                ajax("/framework/SysUser.do?method=update", serializeObject($("#bofrom")), {}, parent.treeGrid);
                return false; //禁用form表单自带的提交
            });
        });

    </script>
</head>

<body class="childBody">
    <form id="bofrom" class="layui-form">
        <%-- 主键 --%>
        <input type="hidden" name="lid" value="${bo.lid}">

        <div class="layui-form-item">
            <label class="layui-form-label"><span style="color:red">*</span>昵称</label>
            <div class="layui-input-block">
                <input type="text" name="cname" class="layui-input" lay-verify="required" value="${bo.cname}">
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label"><span style="color:red">*</span>账号</label>
            <div class="layui-input-block">
                <input type="text" name="account" class="layui-input" lay-verify="required" value="${bo.account}">
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label"><span style="color:red">*</span>角色</label>
            <div class="layui-input-block">
                <%--
                <select name="rolelid" xm-select="rolelid">
                    <option value="1" <c:if test="${bo.rolelid==1}">selected</c:if>>系统管理员</option>
                    <option value="2" <c:if test="${bo.rolelid==2}">selected</c:if>>裕兴昌管理员</option>
                    <option value="3" <c:if test="${bo.rolelid==3}">selected</c:if>>普通用户</option>
                </select>
                --%>
                <select name="rolelid" xm-select="rolelid">
                    <c:forEach items="${roleList}" var="item">
                        <option value="${item.lid}" <c:if test="${item.isThisRole}">selected</c:if>>${item.cname}</option>
                    </c:forEach>
                </select>
                <div id="demo1" class="xm-select-demo"></div>
            </div>
        </div>

        <div class="layui-form-item">
            <label class="layui-form-label">是否冻结</label>
            <div class="layui-input-block">
                <select name="isFreeze" xm-select="isFreeze" xm-select-radio="">
                    <option value="0" <c:if test="${bo.isFreeze==0}">selected</c:if>>否</option>
                    <option value="1" <c:if test="${bo.isFreeze==1}">selected</c:if>>是</option>
                </select>
            </div>
        </div>

        <!--隐藏的提交按钮，提供父页面调用  -->
        <div class="layui-form-item" style="display: none;">
            <div class="layui-input-inline">
                <button class="layui-btn form-submit-btn" lay-submit="" lay-filter="*">立即提交</button>
                <button type="reset" class="layui-btn layui-btn-primary">重置</button>
            </div>
        </div>
    </form>
</body>
</html>
